#ifndef _PROP_H_
#define _PROP_H_
#include <MyString.h>

enum Effect
{
    Frozen,//冰冻
    SuckBlood,//吸血
    Reflex,//反伤
};

enum PropType
{
    Weapon,
    Defence,
    Medicament,
};

struct Prop
{
    enum PropType type;//道具类型
    void* ptr;//指向道具对象的指针
};

typedef struct Prop prop;

prop * CreateProp(enum PropType type, void *ptr);
void FreeProp(void *p, void(* clearPtr)(void *));

 
struct Weapon
{
    MyStr name;
    int attack;
    enum Effect effect;
};

typedef struct Weapon weapon; 

weapon*  CreateWeapon(const char *name,int attack, enum Effect effect);
void FreeWeapon(void *ptr);

struct Defence
{
    MyStr name;
    int defence;
    enum Effect effect;
};

typedef struct Defence defence;

struct Medicament
{
    MyStr name;
    int hp;
    enum Effect effect;
};

typedef struct Medicament medicament;



#endif